package cn.accp.mvc.controller;

import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import cn.accp.mvc.entity.Users;
import cn.accp.mvc.service.UsersService;

@Controller
public class UsersController {
	@Autowired
	private UsersService usersService;
	public void setUsersService(UsersService usersService) {
		this.usersService = usersService;
	}
	@RequestMapping("/login")
	public String login(Users users,HttpSession session){
		session.setAttribute("users", usersService.login(users));
		return "/login.jsp";
	}
}
